#include "plbord.h"

PlBord::PlBord(QWidget *parent) :
    QWidget(parent)
{
    lay = new QVBoxLayout(this);
    lay->setContentsMargins(4,4,4,4);
    setLayout(lay);
    bobs = 0;
}


void PlBord::addbob(Bob *bob) {
    QSize bsz = bob->size();
    bob->setParent(this);
    lay->addWidget(bob);
    bobs += 1;
//    if (!bsz.isEmpty()) resize(width()+4,bobs*(bsz.height()+4));
    bob->show();
}


void PlBord::removebob(Bob *bob) {

    QSize bsz = bob->size();
//    bob->hide();
//    bob->setParent(0);
    lay->removeWidget(bob);
    bobs -= 1;
//    if (!bsz.isEmpty()) resize(width(),bobs*(bsz.height()+4));
}
